let vm = new Vue({
    el: '.main-container',
    data: {
        pageInfo: {},
        condition:{
            type: '',
            check:''
        }
    },
    methods: {
        selectPage: function (pageNum = 1, pageSize = 5) {
            axios({
                url: `/guguanjia/qualification/findAll/${pageNum}/${pageSize}`,
                params: this.condition
            }).then(response => {

                this.pageInfo = response.data;

            }).catch(error => {

                console.log(error.message)
            })
        },

        selectAll:function(){
            this.condition={
                type: '',
                check:''
            };
          this.selectPage()
        },

        toUpdate: function (id) {
            layer.open({
                type: 2,
                skin: 'layui-layer-demo', //样式类名
                title: '编辑',
                closeBtn: 0, //不显示关闭按钮
                anim: 2,
                area: ['80%', '80%'],
                shadeClose: true, //开启遮罩关闭
                content: '/guguanjia/qualification/toUpdate',
                success: function (aa, index) {
                    var iframe = window['layui-layer-iframe' + index];
                    iframe.child2(id)
                },
                end: () => {
                    layer.msg("更新完成")
                    this.selectPage();
                }
            })
        }

    },
    created: function () {
        this.selectPage()
    }
});

